<link rel="stylesheet" href="/css/visualization/search.css">

<script type="text/javascript">
$(function() {
$("#selectallbio,#unselectallbio,#selectalloverlay,#unselectalloverlay" ).click(function() { selectall(this.id); });
$( ".clsoverlayslider" ).slider({
			range: "min",
			value: 70,
			min: 1,
			max: 100,
			slide: function( event, ui ) {
				$( "#overlaytrans"+this.id ).html( "Image Transparency: " + ui.value+ "%" );
                                setOpacity(ui.value,this.id);
			}
		});
	});


</script>


<?php $flgFirst=true ?>
<?php $flgLast=true ?>
<?php if(count($biodata)==0 && count($nonbiodata)==0 && count($overlaydata)==0): ?>
    <span> no data found </span>

<?php return; endif ?>
    
<?php if ($pgTag=="ALL"): ?><div  id="accordion" style="font-size: 8pt; text-align: left;"><?php endif ?>
<?php if (count($biodata)>0): ?>
    <?php if ($pgTag=="ALL"): ?><h3  id="ac1" style="background: url('/images/bluebar.png');  border: none" ><a  href="#" style="color: #464646">Biological Data: <?php echo count($biodata) ?> </a></h3><?php endif ?>
        <?php if ($pgTag=="ALL"): ?><div id="divbiodata" style="background: url('/images/background.jpg') left ; overflow: auto; "><?php endif ?>

            
            <?php if ($pgTag=="ALL" || $pgTag=="BIO"): ?><table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3" style="border-bottom:  solid 1px #cdcdb4; padding-bottom: 5px" >
                            <div style="float: left;padding-left: 5px"><a id="btnshowfilter" class="sall" title="Set Filter" onclick="bioFilterWindow=true;showhideFilter(true)">Set Filter</a></div>
                            <div style="float: right;padding-left: 5px"><a id="unselectallbio" class="sall" title="unselect all">Unselect All</a></div>
                            <div style="float: right;"><a id="selectallbio" class="sall" title="select all">Select All</a></div>
                            

                        </td>
                        
                    </tr>
                <?php foreach ($biodata->getResults() as $metro_bussiness_list): ?>

                    <tbody class="tbsearchresult">
                    <tr >
                        <td align="left" width="10px">
                            <input type="checkbox" value="0" name="chkbio" id="<?php echo $metro_bussiness_list["speciesid"] ?>" style="width: 20px" onclick="searchaction('chkbio',true);"></>
                        </td>
                        <td colspan="2">
                            <span style="font-size: 9pt;font-weight: bold; color: #464646" ><?php echo $metro_bussiness_list["spname"] ?></span>
                        </td>
                    </tr>
                    
                    <tr>
                        <td>
                        </td>
                        <td>
                            <span style="font-size: 7pt;font-weight: normal;color: #3d4a58">Ob. Date: <?php  echo $metro_bussiness_list->Observationdepth->Observation["observationdate"]; ?></span>
                        </td>
                        <td align="right">
                            <a style="cursor: pointer; border: none"   onclick="window.open('http://en.wikipedia.org/wiki/<?php echo $metro_bussiness_list->Species["species"] ?>')"><img src="/images/wiki.png" width="18px"/></a>
                        </td>
                    </tr>

                    </tbody>
                    
                <?php endforeach; ?>
            </table>





            
                <?php if ($biodata->haveToPaginate()): ?>
                    <div style="background-color: transparent; width: 100%; height: 30px; padding-left: 2px; padding-top: 2px">
                    <?php $links = $biodata->getLinks(); foreach ($links as $page): ?>
                        <?php if ($page==$biodata->getFirstpage()): $flgFirst=false; endif ?>
                        <?php if ($page==$biodata->getLastpage()): $flgLast=false; endif ?>
                    <?php endforeach ?>
                    <?php if ($biodata->getPage()!=$biodata->getFirstpage()):?>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $biodata->getPreviousPage() ?>,'BIO')">Previous</a>
                        </div>
                    <?php endif ?>
                    <?php if ($flgFirst==true):?>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $biodata->getFirstPage()?>,'BIO')"><?php echo$biodata->getFirstPage()?></a>
                        </div>
                        <div class="pagination">
                            ..
                        </div>
                    <?php endif ?>
                    

                    <?php $links = $biodata->getLinks(); foreach ($links as $page): ?>
                        <div class="pagination">
                            <?php //echo ($page == $biodata->getPage())// ? $page : link_to($page, 'bussiness/index?page='.$page) ?>
                            <?php if ($biodata->getPage()==$page): ?>
                            <a class="pgnumberactive" onclick="loadpage(<?php echo $page?>,'BIO')"><?php echo $page?></a>
                            <?php else:?>
                            <a class="pgnumber" onclick="loadpage(<?php echo $page?>,'BIO')"><?php echo $page?></a>
                            <?php endif ?>
                        </div>
                    <?php endforeach ?>
                    <?php if ($page!=$biodata->getLastpage() && $flgLast!=false):?>
                        <div class="pagination">
                            ..
                        </div>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $biodata->getLastPage()?>,'BIO')"><?php echo $biodata->getLastPage()?></a>
                        </div>
                    <?php endif ?>
                    <?php if ($biodata->getPage()!=$biodata->getLastpage()):?>
                        <div class="pagination">
                            <a class="pgnumber"  onclick="loadpage(<?php echo $biodata->getNextPage() ?>,'BIO')">Next</a>
                        </div>
                    <?php endif ?>
        <?php if ($pgTag=="ALL"): ?></div><?php endif ?>
                <?php endif ?><?php endif ?>
        <?php if ($pgTag=="ALL"): ?></div><?php endif ?>
    <?php endif ?>



    <!--Non Bio Logical Data Result    -->


    <?php if (count($nonbiodata)>0): ?>
    <?php if ($pgTag=="ALL"): ?><h3 id="ac2" style="background: url('/images/bluebar.png');  border: none" ><a href="#" style="color: #464646">Specific Units: <?php echo count($nonbiodata) ?> </a></h3><?php endif ?>
        <?php if ($pgTag=="ALL"): ?><div id="divnonbiodata" style="background: url('/images/background.jpg') left ; overflow: auto; "><?php endif ?>
            <?php if ($pgTag=="ALL" || $pgTag=="NONBIO"): ?><table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3" style="border-bottom:  solid 1px #cdcdb4; padding-bottom: 5px" >
<!--                            <div style="float: right;padding-left: 5px"><a id="unselectallnonbio" class="sall" title="unselect all">Unselect All</a></div>
                            <div style="float: right;"><a id="selectallnonbio" class="sall" title="select all">Select All</a></div>-->
                          <div style="float: left;padding-left: 5px"><a id="btnshowfilter" class="sall" title="Set Filter" onclick="nonbioFilterWindow=true;showhideFilter(true)">Set Filter</a></div>
                            
                        </td>
                        
                    </tr>
                <?php foreach ($nonbiodata->getResults() as $metro_bussiness_list): ?>
                    <tbody class="tbsearchresult">
                    <tr style="height: 5px">
                        <td colspan="3">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" width="10px">
                            <input type="radio" value="0" name="chknonbio" style="width: 20px" id="<?php echo $metro_bussiness_list->Attribute["id"] ?>" onclick="searchaction('chknonbio',true);"></>
                        </td>
                        <td colspan="2">
                            <span style="font-size: 9pt;font-weight: bold; color: #464646" ><?php echo $metro_bussiness_list->Attribute["attributename"] ?></span>
                        </td>
                        
                    </tr>
                    
                    
                    </tbody>
                <?php endforeach; ?>
            </table>

                <?php if ($nonbiodata->haveToPaginate()): ?>
                    <div style="background-color: #e6e6d2; width: 100%; height: 30px; padding-left: 2px; padding-top: 2px">
                    <?php $links = $nonbiodata->getLinks(); foreach ($links as $page): ?>
                        <?php if ($page==$nonbiodata->getFirstpage()): $flgFirst=false; endif ?>
                        <?php if ($page==$nonbiodata->getLastpage()): $flgLast=false; endif ?>
                    <?php endforeach ?>
                    <?php if ($nonbiodata->getPage()!=$nonbiodata->getFirstpage()):?>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $nonbiodata->getPreviousPage() ?>,'NONBIO')">Previous</a>
                        </div>
                    <?php endif ?>
                    <?php if ($flgFirst==true):?>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $nonbiodata->getFirstPage()?>,'NONBIO')"><?php echo$nonbiodata->getFirstPage()?></a>
                        </div>
                        <div class="pagination">
                            ..
                        </div>
                    <?php endif ?>


                    <?php $links = $nonbiodata->getLinks(); foreach ($links as $page): ?>
                        <div class="pagination">
                            <?php //echo ($page == $nonbiodata->getPage())// ? $page : link_to($page, 'bussiness/index?page='.$page) ?>
                            <?php if ($nonbiodata->getPage()==$page): ?>
                            <a class="pgnumberactive" onclick="loadpage(<?php echo $page?>,'NONBIO')"><?php echo $page?></a>
                            <?php else:?>
                            <a class="pgnumber" onclick="loadpage(<?php echo $page?>,'NONBIO')"><?php echo $page?></a>
                            <?php endif ?>
                        </div>
                    <?php endforeach ?>
                    <?php if ($page!=$nonbiodata->getLastpage() && $flgLast!=false):?>
                        <div class="pagination">
                            ..
                        </div>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $nonbiodata->getLastPage()?>,'NONBIO')"><?php echo $nonbiodata->getLastPage()?></a>
                        </div>
                    <?php endif ?>
                    <?php if ($nonbiodata->getPage()!=$nonbiodata->getLastpage()):?>
                        <div class="pagination">
                            <a class="pgnumber" class="first" onclick="loadpage(<?php echo $nonbiodata->getNextPage() ?>,'NONBIO')">Next</a>
                        </div>
                    <?php endif ?>
                </div>
                <?php endif ?><?php endif?>
        <?php if ($pgTag=="ALL"): ?></div><?php endif ?>
    <?php endif ?>










        <!--Overlay Data Result    -->
        

    <?php if (count($overlaydata)>0): ?>
    <?php if ($pgTag=="ALL"): ?><h3 id="ac3" style="background: url('/images/bluebar.png');  border: none" ><a href="" style="color: #464646">Overlay Data count:<?php echo count($overlaydata) ?> </a></h3><?php endif ?>
        <?php if ($pgTag=="ALL"): ?><div id="divoverlaydata" style="background: url('/images/background.jpg') left ; overflow: auto; "><?php endif ?>
            <?php if ($pgTag=="ALL" || $pgTag=="OVERLAY"): ?><table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3" style="border-bottom:  solid 1px #cdcdb4; padding-bottom: 5px" >
                            <div style="float: right;padding-left: 5px"><a id="unselectalloverlay" class="sall" title="unselect all">Unselect All</a></div>
                            <div style="float: right;"><a id="selectalloverlay" class="sall" title="select all">Select All</a></div>
                        </td>
                        
                    </tr>
                <?php foreach ($overlaydata->getResults() as $metro_bussiness_list): ?>
                    <tbody class="tbsearchresult">
                    <tr style="height: 5px">
                        <td colspan="3">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" width="10px" >
                            <input type="checkbox" value="0" name="chkoverlay" style="width: 20px" id="<?php echo $metro_bussiness_list->getId() ?>" onclick="searchaction('chkoverlay',true);"></>
                        </td>
                        <td colspan="2">
                            <span style="font-size: 9pt;font-weight: bold; color: #464646" ><?php echo $metro_bussiness_list["overlaytitle"] ?></span>
                        </td>
                    </tr>

                    <tr>
                        <td>
                        </td>
                        <td>
                            <span style="font-size: 9pt;font-weight: normal; color: #a1ba94" ><?php echo $metro_bussiness_list["overlaydescription"] ?></span>
                        </td>
                        <td align="right">
                            <span style="font-size: 7pt;font-weight: normal;color: #87875b"><?php  //echo $metro_bussiness_list->Research->Entity["firstname"]; ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <span style="font-size: 7pt;font-weight: normal; color: #87875b">Contributed By: <?php echo $metro_bussiness_list->Research->Entity["firstname"]; ?></span>
                        </td>
                        <td align="right">
                            <span style="font-size: 7pt;font-weight: normal;color: #87875b"><?php  //echo $metro_bussiness_list->Research->Entity["firstname"]; ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: solid 1px #cdcdb4;padding-bottom: 10px; padding-left: 15px; padding-right: 5px">
                            <div style="width: 80%" name="Overlayslider" class="clsoverlayslider" id="<?php echo $metro_bussiness_list->getId() ?>"></div>
                            <div style="padding-left: 15px; font-size: 7pt;" id ="overlaytrans<?php echo $metro_bussiness_list->getId()?>">Image Transparency: 70%</div>
                        </td>
                    </tr>
                    </tbody>
                <?php endforeach; ?>
            </table>

                <?php if ($overlaydata->haveToPaginate()): ?>
                    <div style="background-color: #e6e6d2; width: 100%; height: 30px; padding-left: 2px; padding-top: 2px">
                    <?php $links = $overlaydata->getLinks(); foreach ($links as $page): ?>
                        <?php if ($page==$overlaydata->getFirstpage()): $flgFirst=false; endif ?>
                        <?php if ($page==$overlaydata->getLastpage()): $flgLast=false; endif ?>
                    <?php endforeach ?>
                    <?php if ($overlaydata->getPage()!=$overlaydata->getFirstpage()):?>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $overlaydata->getPreviousPage() ?>,'OVERLAY')">Previous</a>
                        </div>
                    <?php endif ?>
                    <?php if ($flgFirst==true):?>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $overlaydata->getFirstPage()?>,'OVERLAY')"><?php echo$overlaydata->getFirstPage()?></a>
                        </div>
                        <div class="pagination">
                            ..
                        </div>
                    <?php endif ?>


                    <?php $links = $overlaydata->getLinks(); foreach ($links as $page): ?>
                        <div class="pagination">
                            <?php //echo ($page == $overlaydata->getPage())// ? $page : link_to($page, 'bussiness/index?page='.$page) ?>
                            <?php if ($overlaydata->getPage()==$page): ?>
                            <a class="pgnumberactive" onclick="loadpage(<?php echo $page?>,'OVERLAY')"><?php echo $page?></a>
                            <?php else:?>
                            <a class="pgnumber" onclick="loadpage(<?php echo $page?>,'OVERLAY')"><?php echo $page?></a>
                            <?php endif ?>
                        </div>
                    <?php endforeach ?>
                    <?php if ($page!=$overlaydata->getLastpage() && $flgLast!=false):?>
                        <div class="pagination">
                            ..
                        </div>
                        <div class="pagination">
                            <a class="pgnumber" onclick="loadpage(<?php echo $overlaydata->getLastPage()?>,'OVERLAY')"><?php echo $overlaydata->getLastPage()?></a>
                        </div>
                    <?php endif ?>
                    <?php if ($overlaydata->getPage()!=$overlaydata->getLastpage()):?>
                        <div class="pagination">
                            <a class="pgnumber" class="first" onclick="loadpage(<?php echo $overlaydata->getNextPage() ?>,'OVERLAY')">Next</a>
                        </div>
                    <?php endif ?>
                </div>
                <?php endif ?><?php endif?>
        <?php if ($pgTag=="ALL"): ?></div><?php endif ?>
    <?php endif ?>




<?php if ($pgTag=="ALL"): ?></div><?php endif ?>


